<template>
  <div class="teadata">
    <div
      class="mycl"
      v-for="item in Searchdata"
      :key="item.pid"
      @click="goDetail(item.pid)"
    >
      <img :src="item.smallImg" alt="" />
      <div class="name-box">
        <div class="name">{{ item.name }}</div>
        <div class="enname">{{ item.enname }}</div>
      </div>
      <div class="price-box">
        <div class="price">￥{{ item.price }}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Teadata",
  props: ["Searchdata"],
  methods: {
    //详情
    goDetail(pid) {
      this.$router.push({ name: "Detail", params: { pid } });
    },
  },
};
</script>

<style lang="less" scoped>
.teadata {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  padding: 10px;
  box-sizing: border-box;
  .mycl {
    width: 105px;
    margin-right: 10px;
    margin-bottom: 10px;
    text-align: left;
    color: #8c9198;
    &:nth-of-type(3n + 0) {
      margin-right: 0;
    }
    img {
      width: 100%;
      display: block;
    }
    .name-box {
      margin: 5px auto;
      .name {
        font-size: 14px;
        color: #3d444d;
        margin-bottom: 5px;
        overflow: hidden; 
        text-overflow:ellipsis;
        white-space: nowrap;
      }
      .enname {
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
    .price-box {
      display: flex;
      align-items: center;
      .price {
        color: #05a1f4;
        font-size: 14px;
        font-weight: bold;
        margin-right: auto;
      }
    }
  }
}
</style>